import com.spring.demo.Student;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

public class App2 {
    public static void main(String[] args) {
        //1. 得到 Spring 上下文对象
        BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("spring-config.xml"));
        //2.从 Spring 容器中 获取 bean 对象
        Student student = (Student) beanFactory.getBean("student");
        //3.使用 Bean
        student.sayHi();
    }
}
